import names, {collection} from './_names.js'; export function get(req, res) { const name = names.find(n => n.name === req.params.name); if (name == null) { res.writeHead(404, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({code: 404, error: "Not found"})); return; } res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({name, collection})); }